package com.nantian.logic.entity.ImgAddressEntity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "img_address", schema = "springBoot")
public class ImgAddressEntity {
    private String imgId;
    private String imgAddress;
    private String uploadDate;
    private Byte del;
    private String userid;
    private String type;

    @Id
    @Column(name = "img_id", nullable = false)
    public String getImgId() {
        return imgId;
    }

    public void setImgId(String imgId) {
        this.imgId = imgId;
    }

    @Basic
    @Column(name = "img_address", nullable = false, length = 200)
    public String getImgAddress() {
        return imgAddress;
    }

    public void setImgAddress(String imgAddress) {
        this.imgAddress = imgAddress;
    }

    @Basic
    @Column(name = "upload_date", nullable = true, length = 30)
    public String getUploadDate() {
        return uploadDate;
    }

    public void setUploadDate(String uploadDate) {
        this.uploadDate = uploadDate;
    }


    @Basic
    @Column(name = "del", nullable = true)
    public Byte getDel() {
        return del;
    }

    public void setDel(Byte del) {
        this.del = del;
    }

    @Basic
    @Column(name = "userid", nullable = true, length = 50)
    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    // 0 个人头像 1
    @Basic
    @Column(name = "type", nullable = true, length = 2)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ImgAddressEntity that = (ImgAddressEntity) o;
        return imgId == that.imgId &&
                Objects.equals(imgAddress, that.imgAddress) &&
                Objects.equals(uploadDate, that.uploadDate) &&
                Objects.equals(del, that.del) &&
                Objects.equals(userid, that.userid) &&
                Objects.equals(type, that.type);
    }

    @Override
    public int hashCode() {

        return Objects.hash(imgId, imgAddress, uploadDate, del, userid, type);
    }
}
